From 713df0c72b85e990505dee7939497ab166f27d39 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Thu, 15 Dec 2011 15:54:59 +0100 Subject: [PATCH] menuitem: force odd height if we're not using wide separators So that the 1px line can receive the same amount of space above and below. https://bugzilla.gnome.org/show_bug.cgi?id=666242 --- gtk/gtkmenuitem.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c index 46491474a4..e9c2bea56c 100644 --- a/gtk/gtkmenuitem.c +++ b/gtk/gtkmenuitem.c @@ -945,6 +945,16 @@ gtk_menu_item_get_preferred_height (GtkWidget *widget, min_height += separator_height; nat_height += separator_height; } + else + { + /* force odd, so that we can have the same space above and + * below the line. + */ + if (min_height % 2 == 0) + min_height += 1; + if (nat_height % 2 == 0) + nat_height += 1; + } } accel_width = 0; @@ -1071,6 +1081,16 @@ gtk_menu_item_get_preferred_height_for_width (GtkWidget *widget, min_height += separator_height; nat_height += separator_height; } + else + { + /* force odd, so that we can have the same space above and + * below the line. + */ + if (min_height % 2 == 0) + min_height += 1; + if (nat_height % 2 == 0) + nat_height += 1; + } } if (minimum_size) -- 2.30.2